home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / oper_sys / oasis / ossxmpls.lha / examples / ack.c next >
Encoding:
C/C++ Source or Header  |  1992-03-25  |  209 b   |  17 lines

  1. /* C version of ack benchmark */
  2.  
  3. #include <stdio.h>
  4.  
  5. int ack(m,n)
  6. int m,n;
  7. {
  8.   if (m == 0) return n+1;
  9.   if (n == 0) return ack(m-1,1);
  10.   return ack(m-1,ack(m,n-1));
  11. }
  12.  
  13. main()
  14. {
  15.   printf("%d\n", ack(3,8));
  16. }
  17.